Skip to content

Update instruction how to update contraints files #672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 20, 2025

Conversation

Czaki
Copy link
Contributor

@Czaki Czaki commented Apr 14, 2025

References and relevant issues

closes #670

napari/napari#7642
napari/napari#7487

Description

After the most recent updates of constraints update, we could simplify this instrucition.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 14, 2025
cnstt
cnstt previously requested changes Apr 14, 2025

```bash
uv pip compile --python-version 3.11 --upgrade --output-file resources/constraints/constraints_py3.11_docs.txt pyproject.toml resources/constraints/version_denylist.txt resources/constraints/version_denylist_examples.txt ../docs/requirements.txt resources/constraints/pydantic_le_2.txt --extra pyqt5 --extra pyqt6 --extra pyside2 --extra pyside6_experimental --extra testing --extra testing_extra --extra optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't resources/constraints/version_denylist_examples.txt be kept (as in napari/napari#7788 ) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed from docs to normal constraints, as docs are still on python 3.10.

Once we understand the source of problems in #7714 we may get docs constraints here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is now resolved as napari/napari#7714 is merged! Can we add this in here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@melissawm I think bumping to 3.12 makes sense now that #7714 has landed.

Copy link
Contributor

@TimMonko TimMonko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works locally now (with my comment), thanks!


```bash
uv pip compile --python-version 3.11 --upgrade --output-file resources/constraints/constraints_py3.11_docs.txt pyproject.toml resources/constraints/version_denylist.txt resources/constraints/version_denylist_examples.txt ../docs/requirements.txt resources/constraints/pydantic_le_2.txt --extra pyqt5 --extra pyqt6 --extra pyside2 --extra pyside6_experimental --extra testing --extra testing_extra --extra optional
uv pip compile --python-version 3.12 --output-file resources/constraints/constraints_py3.12.txt pyproject.toml resources/constraints/version_denylist.txt --extra pyqt6 --extra pyside2 --extra pyside6_experimental --extra testing --extra testing_extra --extra optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this updates 3.12, we want to update docs though, right? I think this does that

Suggested change
uv pip compile --python-version 3.12 --output-file resources/constraints/constraints_py3.12.txt pyproject.toml resources/constraints/version_denylist.txt --extra pyqt6 --extra pyside2 --extra pyside6_experimental --extra testing --extra testing_extra --extra optional
uv pip compile --python-version 3.10 --output-file resources/constraints/constraints_py3.10_docs.txt pyproject.toml resources/constraints/version_denylist.txt --extra pyqt6 --extra pyside2 --extra pyside6_experimental --extra testing --extra testing_extra --extra optional

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can now use 3.12 here 🎉

@psobolewskiPhD
Copy link
Member

@napari-bot make slimgallery

@willingc
Copy link
Contributor

Team, let's try to land this doc pr this week.

willingc and others added 2 commits July 17, 2025 13:43
@willingc willingc added this to the 0.6.3 milestone Jul 17, 2025
@willingc willingc dismissed cnstt’s stale review July 17, 2025 21:53

Resolved by napari/napari #7714

@willingc
Copy link
Contributor

willingc commented Jul 18, 2025

@melissawm This worked fine for creating the constraint file for 3.12.

Running make docs with 3.12.11 threw a traceback when embedding hyperlinks:

embedding documentation hyperlinks...

Traceback (most recent call last):
  File "/Users/willingc/Code/repos-napari/napari-docs/.venv/lib/python3.12/site-packages/sphinx/events.py", line 98, in emit
    results.append(listener.handler(self.app, *args))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/willingc/Code/repos-napari/napari-docs/.venv/lib/python3.12/site-packages/sphinx_gallery/docs_resolv.py", line 502, in embed_code_links
    _embed_code_links(app, gallery_conf, gallery_dir)
  File "/Users/willingc/Code/repos-napari/napari-docs/.venv/lib/python3.12/site-packages/sphinx_gallery/docs_resolv.py", line 341, in _embed_code_links
    doc_resolvers[this_module] = SphinxDocLinkResolver(
                                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/willingc/Code/repos-napari/napari-docs/.venv/lib/python3.12/site-packages/sphinx_gallery/docs_resolv.py", line 166, in __init__
    index = get_data(index_url, gallery_dir)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/willingc/Code/repos-napari/napari-docs/.venv/lib/python3.12/site-packages/sphinx_gallery/docs_resolv.py", line 50, in get_data
    search_index = shelve.open(cached_file)
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shelve.py", line 227, in __init__
    Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
                         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/dbm/__init__.py", line 89, in open
    raise error[0]("db type could not be determined")
dbm.error: db type could not be determined

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/willingc/Code/repos-napari/napari-docs/.venv/lib/python3.12/site-packages/sphinx/cmd/build.py", line 337, in build_main
    app.build(args.force_all, args.filenames)
  File "/Users/willingc/Code/repos-napari/napari-docs/.venv/lib/python3.12/site-packages/sphinx/application.py", line 380, in build
    self.events.emit('build-finished', None)
  File "/Users/willingc/Code/repos-napari/napari-docs/.venv/lib/python3.12/site-packages/sphinx/events.py", line 109, in emit
    raise ExtensionError(
sphinx.errors.ExtensionError: Handler <function embed_code_links at 0x104129440> for event 'build-finished' threw an exception (exception: db type could not be determined)

Extension error (sphinx_gallery.docs_resolv):
Handler <function embed_code_links at 0x104129440> for event 'build-finished' threw an exception (exception: db type could not be determined)
make: *** [docs] Error 2

napari-docs on  update_constraints [$] via  v3.12.11 (napari-docs) took 3m26s

There were also several OMP: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead. thrown on some notebook executions.


Reran after installing optional-numba. Got the spinning ball of doom after hitting the first OMP output on my M1 mac.

@psobolewskiPhD
Copy link
Member

psobolewskiPhD commented Jul 18, 2025

I don't have 3.12 handy right now, but ran in my 3.13 docs env.
make docs completed, but with some seg faults on exit -- alas, i sometimes see those when using and exiting napari.
Which triangulation backend do you have @willingc ? I'm running fastest available and bermuda
I dont see OMP warnings.

edit: note: make html is the full build command.

@psobolewskiPhD
Copy link
Member

napari info:

napari: 0.6.2rc1.dev71+g0294fad15
Platform: macOS-14.5-arm64-arm-64bit-Mach-O
System: MacOS 14.5
Python: 3.13.3 | packaged by conda-forge | (main, Apr 14 2025, 20:44:30) [Clang 18.1.8 ]
Qt: 6.9.0
PyQt6: 6.9.0
NumPy: 2.2.6
SciPy: 1.15.3
Dask: 2025.5.1
VisPy: 0.15.2
magicgui: 0.10.0
superqt: 0.7.3
in-n-out: 0.2.1
app-model: 0.3.1
psygnal: 0.13.0
npe2: 0.7.9
pydantic: 2.11.5

OpenGL:
  - PyOpenGL: 3.1.9
  - GL version:  2.1 Metal - 88.1
  - MAX_TEXTURE_SIZE: 16384
  - GL_MAX_3D_TEXTURE_SIZE: 2048

Screens:
  - screen 1: resolution 1680x1050, scale 2.0

Optional:
  - numba: 0.61.2
  - triangle: 20250106
  - napari-plugin-manager: 0.1.6
  - bermuda: 0.1.4
  - PartSegCore not installed

Experimental Settings:
  - Async: False
  - Autoswap buffers: False
  - Triangulation backend: Fastest available

Settings path:
  - /Users/piotrsobolewski/Library/Application Support/napari/napari-dev_a1eb8b76ba95fa16ad06e26097b46b8455dfbf0b/settings.yaml

Launch command:
  - /Users/piotrsobolewski/Dev/miniforge3/envs/napari-dev/bin/napari --info

Plugins:
  - napari-animation: 0.0.8 (2 contributions)
  - napari-skimage: 0.5.0 (64 contributions)
  - napari: 0.6.2.dev11+g6371fffe9 (84 contributions)
  - napari-tiff: 0.1.5.dev1+gebf2362 (2 contributions)
  - napari-svg: 0.2.1 (2 contributions)
  - napari-console: 0.1.3 (0 contributions)
  

@Czaki
Copy link
Contributor Author

Czaki commented Jul 19, 2025

What is currently blocking?

@psobolewskiPhD
Copy link
Member

I think nothing, per se.
I think Carol just tried to build the docs using py312 constraints and they crashed, but I think making the constraints worked.
But building docs with py312 is a different issue & Pr.

@willingc
Copy link
Contributor

Let's land this. I was able to clean and regenerate. All seems well.

@willingc willingc merged commit 80e18d1 into napari:main Jul 20, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instructions for local updating of docs constraints out of date
6 participants